package com.hcf.streaming

import java.security.MessageDigest
import java.text.SimpleDateFormat
import java.util.Date

import scala.collection.mutable
import scala.collection.mutable.ListBuffer


/**
 * Created by hyt on 2018/9/10.
 */
object test {

  def main(args: Array[String]): Unit = {

    /*val table_name = "hyzs.id_mapping"
    val sdf = new SimpleDateFormat("yyyyMMddHHmmss")
    println(String.format("alter table %s rename to %s", table_name, table_name + "_bak_" + sdf.format(new Date())))
    val list = mutable.ListBuffer[String]("","identity__410221199312019879","")
    val digest = MessageDigest.getInstance("MD5")
    digest.update(list(1).getBytes)
    //获取字节数组
    val messageDigest = digest.digest
    println(messageDigest.map("%02x".format(_)).mkString)

    print(digest.digest("identity__410221199312019879".getBytes).map("%02x".format(_)).mkString)*/
    val digest = MessageDigest.getInstance("MD5")
    val list = ListBuffer("", "identity__440301196705104435", "", "nsrsbh__440300792553796")
    println(list)
    list(0) = digest.digest(list(1).getBytes).map("%02x".format(_)).mkString
    println(list)

  }
}
